package com.xmu.makerspace.controller;

import com.xmu.makerspace.domain.MiddleTermResult;
import com.xmu.makerspace.model.seat.MaterialDTO;
import com.xmu.makerspace.service.MidAuditService;
import com.xmu.makerspace.service.TeamManagementService;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("team_management/_mid_term")
public class MidAuditControllor {
    private MidAuditService midAuditService;
    public MidAuditControllor(MidAuditService midAuditService)
    {
        this.midAuditService=midAuditService;
    }
    @PostMapping("checking")
    public void submitMaterial(@RequestBody MaterialDTO dto)//提交中期材料到数据库
    {
        midAuditService.addMiddle_term_submit(dto);
    }
    @PostMapping("_get_condition/{teamId}")
    public int getCondition(@PathVariable("teamId")int teamId)//获取团队提交信息状态
    {
        return midAuditService.findTeamById(teamId);//返回团队提交信息状态
    }
    @GetMapping("_data_check_result/{teamId}")
    public MiddleTermResult getTheResult(@PathVariable("teamId") int teamId)
    {
        return midAuditService.getMiddleTermResult(teamId);//返回中期评价成果
    }
}
